//9进制转10进制
#include <iostream>
using namespace std;
typedef long long ll;
int main()
{
	ll ans = 0;
	string s = "2022";
	ll k = 9;
	for(int i = 0; i < s.size(); i++)
	{
		ans = ans * k + (s[i] - '0') ;
	}
	cout << ans;
	return 0;
}
